<?php 
	/*
		UserCake Version: 1.4
		http://usercake.com
		
		Thanks to Jonas Laursen
	*/
	require_once("../models/config.php");
	$pagename= "Submit News Article"
?>

<?php include("../layout_inc/header.php"); ?>
<div id="content_main">
           <h3>Post news articles</h3>
            <p>
            <p><?php

if(isset($_POST['submit'])) {
					
					$title = $_POST['title'];
					$content = $_POST['content'];
					$author = $_POST['author'];
					$date = date("Y-m-d");
					
					mysql_query("INSERT INTO `DreamCMS_News` (title, content, author, date)
											VALUES ('$title', '$content', '$author', '$date')") OR DIE(mysql_error());
											
					echo "<h1>Article successfully added.</h1>";
					
					}
					
					echo "
					<form action='' method='post'>
					Title: <input name=title type=text><br/>
					<textarea name=content rows=5 cols=50>News Article Here</textarea><br/>
					Author: <input name=author type=text><br/>
					<input type=submit name=submit value='Post'>
					
					";
					
?>
</p>
        </div>
    
    <div id="nav_main">
        <h4>Navigation</h4>
        <ul>
          <?php include("../layout_inc/right-nav.php"); ?>
        </ul>
    </div>
    
    
</div>

<?php include("../layout_inc/footer.php"); ?>

</body>
</html>
